﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Blog
{
    interface Blogpostdelivery
    {
        /// <summary>
        /// Add a new entry to the blog
        /// </summary>
        /// <param name="username">The username for the blog entry</param>
        /// <param name="language">The language of the blog entry</param>
        /// <param name="title">The title element for the blog entry</param>
        /// <param name="body">The body element for the blog entry</param>
        /// <returns>Returns true if the entry was added successfully</returns>
        /// <exception cref="Exception">This function may throw a number of exceptions.</exception>
        bool AddEntry(string username, string language, string title, string body);
        /// <summary>
        /// Get a list of all the users who have one or more entries on the Blog.
        /// </summary>
        /// <returns>Returns a list of usernames in an XML formatted string</returns>
        string GetUsernames();
        /// <summary>
        /// Retrieve a list of entries written by a single user, limiting the result by count and offset.
        /// The result is ordered by data, newest entries first.
        /// </summary>
        /// <param name="username">The username of the user who's entries you retrieve</param>
        /// <param name="count">The number of entries in the result</param>
        /// <param name="offset">The number of entries that should be skipped.</param>
        /// <returns>A XML formatted string containing the requested entries.</returns>
        string GetEntriesByUser(string username, int count, int offset);
        /// <summary>
        /// Retrieve a list of entries written by any user, limiting the result by count and offset.
        /// The result is ordered by data, newest entries first.
        /// </summary>
        /// <param name="count">The number of entries in the result</param>
        /// <param name="offset">The number of entries that should be skipped.</param>
        /// <returns>A XML formatted string containing the requested entries.</returns>
        string GetEntries(int count, int offset);
    }
}
